class InitialSchema < ActiveRecord::Migration
  def self.up
    create_table "feeds" do |b|
      b.column "link", :string
      b.column "title", :string
      b.column "description", :string
      b.column "pubDate", :datetime
      b.column "language", :string
      b.column "error_tag", :integer
      b.column "site_url", :string
    end
    
    create_table "items" do |i|
      i.column "feed_id", :integer
      i.column "title", :string
      i.column "link", :string
      i.column "pubDate", :string
      i.column "comments", :string
      i.column "author", :string
      i.column "commentRss", :string
      i.column "description", :string
    end
    
    create_table "categories" do |c|
      c.column "name", :string
    end
    
    create_table "categories_items" do |f|
      f.column "item_id", :integer
      f.column "category_id", :integer
    end
  end

  def self.down
    drop_table :feeds
    drop_table :items
    drop_table :categories
    drop_table :categories_items
  end
end
